package ru.paswd.marketprice.storage.receipt.app.repositories;

import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import ru.paswd.marketprice.storage.receipt.app.entity.FiscalId;
import ru.paswd.marketprice.storage.receipt.app.entity.Receipt;

import java.util.Optional;
import java.util.UUID;

@Repository
public interface ReceiptsRepository extends PagingAndSortingRepository<Receipt, UUID> {
    Optional<Receipt> findFirstByFiscalId(FiscalId fiscalId);

    boolean existsByFiscalId(FiscalId fiscalId);

    void deleteAllByFiscalId(FiscalId fiscalId);
}
